Skip to content

[19.0][MIG] Migrate DMS modules to 19.0#474

Open
HaithamSaqr wants to merge 8 commits into
OCA:19.0from
HaithamSaqr:19.0
Open

[19.0][MIG] Migrate DMS modules to 19.0#474
HaithamSaqr wants to merge 8 commits into
OCA:19.0from
HaithamSaqr:19.0

Conversation

@HaithamSaqr
Copy link
Copy Markdown

Migration of DMS modules from 18.0 to 19.0

This PR migrates the following 7 modules to Odoo 19.0:

  • dms — Document Management System (core)
  • dms_field — Embedded DMS for any record
  • dms_auto_classification — Auto classify documents
  • dms_field_auto_classification — Auto classify embedded files
  • hr_dms_field — DMS for employees
  • web_editor_media_dialog_dms — Use DMS files in HTML editor
  • dms_user_role — Link DMS access groups to user roles

Migration Patterns Applied

Field renames in Odoo 19

  • res.groups.usersres.groups.user_ids
  • res.users.groups_idres.users.group_ids
  • ir.actions.server.groups_idir.actions.server.group_ids
  • ir.actions.act_window.groups_idir.actions.act_window.group_ids

New res.groups.privilege model

  • res.groups.category_id removed → replaced with res.groups.privilege_id
    pointing to a new res.groups.privilege record (which keeps the
    category_id → ir.module.category relation).

View / RNG schema strict in 19

  • Removed deprecated <group expand="0" string="Group By"> attributes from
    search views (no longer accepted by RNG schema).
  • Removed unsupported target="inline" from ir.actions.act_window.

Python ORM changes

  • Replaced _where_calc / _apply_ir_rules SQL helpers (removed in 19)
    with the standard ORM search() API in dms_field.

JS / OWL changes

  • mail.store.Attachmentmail.store["ir.attachment"].
  • web_editor module removed in 19 → web_editor_media_dialog_dms now
    depends on html_editor. JS imports updated accordingly.
  • Fixed XPath in OWL inheritances (expr="//div"expr=".") for the
    now-empty web.KanbanView.Buttons / web.ListView.Buttons templates.

hr model changes

  • hr.employee.base removed in Odoo 19 → moved dms.field.mixin
    inheritance to hr.employee and hr.employee.public directly.
  • View XPath: <field name="user_id"><field name="name"> on
    hr.employee.public form (user_id no longer present in the form view).
  • Block name: employee_rights_setting_container
    employees_setting_container in hr.res_config_settings_view_form.

Tested

All 7 modules install successfully on Odoo 19 CE and basic functionality
works (directory creation, file upload, kanban view, embedded DMS on
partners and employees, auto-classification wizard, HTML editor media
dialog).

🤖 Generated with Claude Code

HaithamSaqr and others added 7 commits May 3, 2026 12:23
- Update version to 19.0.1.0.0
- res.groups.users → user_ids (renamed in Odoo 19)
- res.users.groups_id → group_ids (renamed in Odoo 19)
- ir.actions.server.groups_id → group_ids
- res.groups.category_id → privilege_id (new res.groups.privilege model)
- Remove deprecated <group expand="0" string="Group By"> attributes
- Remove unsupported target="inline" on ir.actions.act_window
- Fix XPath in OWL templates (//div → .) for empty KanbanView/ListView Buttons
- store.Attachment → store["ir.attachment"] in JS

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Update version to 19.0.1.0.0
- Replace deprecated _where_calc/_apply_ir_rules SQL with ORM search() API
- Add defensive null checks in dms_list_controller processProps()

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Update version to 19.0.1.0.0
- ir.actions.act_window.groups_id → group_ids (renamed in Odoo 19)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Update version to 19.0.1.0.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Update version to 19.0.1.0.0
- res.users.groups_id → group_ids in test
- Remove res.groups.category_id (field removed in Odoo 19)
- hr.employee.base removed in Odoo 19: move dms.field.mixin
  inheritance to hr.employee and hr.employee.public directly
- View XPath: <field name="user_id"> → <field name="name"> on
  hr.employee.public form (user_id no longer in form view in 19)
- Block name: employee_rights_setting_container → employees_setting_container
  in hr res.config.settings (renamed in Odoo 19)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Update version to 19.0.1.0.0
- Replace web_editor dependency with html_editor (web_editor removed in 19)
- Update JS import: @web_editor/components/media_dialog/search_media
  → @html_editor/main/media/media_dialog/search_media

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Update version to 19.0.1.0.0

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@OCA-git-bot OCA-git-bot added mod:dms Module dms mod:dms_field Module dms_field mod:hr_dms_field Module hr_dms_field mod:web_editor_media_dialog_dms Module web_editor_media_dialog_dms mod:dms_user_role Module dms_user_role mod:dms_auto_classification Module dms_auto_classification mod:dms_field_auto_classification Module dms_field_auto_classification series:19.0 labels May 3, 2026
@arielbarreiros96
Copy link
Copy Markdown

Hello @HaithamSaqr, normally the PRs are for a single module, that way is way easier to review the code (it is also OCA common practice 😅). I would recommend you to take a look at the guidelines over here https://github.com/OCA/odoo-community.org/blob/master/website/Contribution/CONTRIBUTING.rst

dnplkndll added a commit to ledoent/dms that referenced this pull request May 12, 2026
- Bump manifest version to 19.0.1.0.0.
- Adopt 19.0 group privilege model: replace res.groups.category_id with
  privilege_id and the new res.groups.privilege record.
- Simplify to a 2-tier security structure (user / manager); group_dms_user
  now implies base.group_user directly. Removed group_dms_viewer.
- res.users.groups_id → group_ids (demo XML + tests).
- res.groups.users → user_ids in access_groups._compute_users dependency.
- auto_join=True/False → bypass_search_access=True/False on 10 fields
  across access_groups, directory, dms_file, storage.
- _sql_constraints → models.Constraint in dms_category, access_groups, tag.
- odoo.osv.expression → odoo.fields.Domain (all imports + AND/OR/Domain.TRUE
  /FALSE/NEGATIVE_OPERATORS aliases at module top).
- read_group → _read_group with the new aggregate-tuple return format in
  dms_security_mixin._get_domain_by_inheritance.
- @http.route(type='json') → type='jsonrpc' on the onboarding controller.
- Translation modernisation per pylint_odoo 19.0 (W8161 prefer-env-translation
  + W8301 translation-not-lazy): replace 'from odoo import _' with
  self.env._() and lazy positional/keyword formatting throughout controllers
  and models.
- DMS access filter restoration: override _search() on dms.security.mixin
  to AND the access-group + inheritance domain into all non-su searches.

  19.0 changed ir.rule._compute_domain() to use Domain.optimize (basic
  level) instead of optimize_full, which means 'search=' methods on
  computed-Boolean fields like permission_read are silently bypassed when
  rule domain_force is evaluated. Without this override the
  [('permission_read', '=', user.id)] global rules no-op and every user
  sees every record.
- _search_starred now handles both '=' and 'in' operators (19.0's basic
  optimizer normalises ('starred','=',True) to ('starred','in',{True}),
  which the old single-operator branch did not recognise).
- Demo-data test guards: tests referencing dms.file_*_demo /
  base.partner_demo_portal now skipTest() when the xmlid isn't found,
  since 19.0 defaults to with_demo=False on CI.
- index=True → index='btree' on dms_file.attachment_id.
- _get_ref_selection(): pylint: disable=no-search-all (intentional,
  enumerates all registered models for the reference selection).
- View / JS cleanups (adopted from OCA#474 by @HaithamSaqr): removed
  deprecated <group expand='0' string='Group By'> attributes; removed
  unsupported target='inline' on ir.actions.act_window; fixed OWL XPath
  '//div' → '.' in empty KanbanView/ListView Buttons templates; replaced
  store.Attachment with store['ir.attachment'] in attachment JS models.
dnplkndll added a commit to ledoent/dms that referenced this pull request May 12, 2026
- Bump manifest version to 19.0.1.0.0.
- Adopt 19.0 group privilege model: replace res.groups.category_id with
  privilege_id and the new res.groups.privilege record.
- Simplify to a 2-tier security structure (user / manager); group_dms_user
  now implies base.group_user directly. Removed group_dms_viewer.
- res.users.groups_id → group_ids (demo XML + tests).
- res.groups.users → user_ids in access_groups._compute_users dependency.
- auto_join=True/False → bypass_search_access=True/False on 10 fields
  across access_groups, directory, dms_file, storage.
- _sql_constraints → models.Constraint in dms_category, access_groups, tag.
- odoo.osv.expression → odoo.fields.Domain (all imports + AND/OR/Domain.TRUE
  /FALSE/NEGATIVE_OPERATORS aliases at module top).
- read_group → _read_group with the new aggregate-tuple return format in
  dms_security_mixin._get_domain_by_inheritance.
- @http.route(type='json') → type='jsonrpc' on the onboarding controller.
- Translation modernisation per pylint_odoo 19.0 (W8161 prefer-env-translation
  + W8301 translation-not-lazy): replace 'from odoo import _' with
  self.env._() and lazy positional/keyword formatting throughout controllers
  and models.
- DMS access filter restoration: override _search() on dms.security.mixin
  to AND the access-group + inheritance domain into all non-su searches.

  19.0 changed ir.rule._compute_domain() to use Domain.optimize (basic
  level) instead of optimize_full, which means 'search=' methods on
  computed-Boolean fields like permission_read are silently bypassed when
  rule domain_force is evaluated. Without this override the
  [('permission_read', '=', user.id)] global rules no-op and every user
  sees every record.
- _search_starred now handles both '=' and 'in' operators (19.0's basic
  optimizer normalises ('starred','=',True) to ('starred','in',{True}),
  which the old single-operator branch did not recognise).
- Demo-data test guards: tests referencing dms.file_*_demo /
  base.partner_demo_portal now skipTest() when the xmlid isn't found,
  since 19.0 defaults to with_demo=False on CI.
- index=True → index='btree' on dms_file.attachment_id.
- _get_ref_selection(): pylint: disable=no-search-all (intentional,
  enumerates all registered models for the reference selection).
- View / JS cleanups (adopted from OCA#474 by @HaithamSaqr): removed
  deprecated <group expand='0' string='Group By'> attributes; removed
  unsupported target='inline' on ir.actions.act_window; fixed OWL XPath
  '//div' → '.' in empty KanbanView/ListView Buttons templates; replaced
  store.Attachment with store['ir.attachment'] in attachment JS models.
dnplkndll added a commit to ledoent/dms that referenced this pull request May 12, 2026
- Bump manifest version to 19.0.1.0.0.
- Adopt 19.0 group privilege model: replace res.groups.category_id with
  privilege_id and the new res.groups.privilege record.
- Simplify to a 2-tier security structure (user / manager); group_dms_user
  now implies base.group_user directly. Removed group_dms_viewer.
- res.users.groups_id → group_ids (demo XML + tests).
- res.groups.users → user_ids in access_groups._compute_users dependency.
- auto_join=True/False → bypass_search_access=True/False on 10 fields
  across access_groups, directory, dms_file, storage.
- _sql_constraints → models.Constraint in dms_category, access_groups, tag.
- odoo.osv.expression → odoo.fields.Domain (all imports + AND/OR/Domain.TRUE
  /FALSE/NEGATIVE_OPERATORS aliases at module top).
- read_group → _read_group with the new aggregate-tuple return format in
  dms_security_mixin._get_domain_by_inheritance.
- @http.route(type='json') → type='jsonrpc' on the onboarding controller.
- Translation modernisation per pylint_odoo 19.0 (W8161 prefer-env-translation
  + W8301 translation-not-lazy): replace 'from odoo import _' with
  self.env._() and lazy positional/keyword formatting throughout controllers
  and models.
- DMS access filter restoration: override _search() on dms.security.mixin
  to AND the access-group + inheritance domain into all non-su searches.

  19.0 changed ir.rule._compute_domain() to use Domain.optimize (basic
  level) instead of optimize_full, which means 'search=' methods on
  computed-Boolean fields like permission_read are silently bypassed when
  rule domain_force is evaluated. Without this override the
  [('permission_read', '=', user.id)] global rules no-op and every user
  sees every record.
- _search_starred now handles both '=' and 'in' operators (19.0's basic
  optimizer normalises ('starred','=',True) to ('starred','in',{True}),
  which the old single-operator branch did not recognise).
- Demo-data test guards: tests referencing dms.file_*_demo /
  base.partner_demo_portal now skipTest() when the xmlid isn't found,
  since 19.0 defaults to with_demo=False on CI.
- index=True → index='btree' on dms_file.attachment_id.
- _get_ref_selection(): pylint: disable=no-search-all (intentional,
  enumerates all registered models for the reference selection).
- View / JS cleanups (adopted from OCA#474 by @HaithamSaqr): removed
  deprecated <group expand='0' string='Group By'> attributes; removed
  unsupported target='inline' on ir.actions.act_window; fixed OWL XPath
  '//div' → '.' in empty KanbanView/ListView Buttons templates; replaced
  store.Attachment with store['ir.attachment'] in attachment JS models.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:dms_auto_classification Module dms_auto_classification mod:dms_field_auto_classification Module dms_field_auto_classification mod:dms_field Module dms_field mod:dms_user_role Module dms_user_role mod:dms Module dms mod:hr_dms_field Module hr_dms_field mod:web_editor_media_dialog_dms Module web_editor_media_dialog_dms series:19.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants